<template>
  <!-- 我的流水记录 -->
  <div class="form-box">
    <el-table height="55vh" :data="list" stripe border>
      <el-table-column label="序号" type="index" width="60" align="center" />
      <el-table-column label="流水时间" prop="createTime" width="160" align="center" />
      <el-table-column label="流水类型" prop="typeCode" width="150" align="center">
        <template slot-scope="scope">
          {{selectDictLabel(typeCode,scope.row.typeCode)}}
        </template>
      </el-table-column>
      <el-table-column label="入账金额" prop="inMoney" width="80" align="center" />
      <el-table-column label="出账金额" prop="outMoney" width="80" align="center" />
      <el-table-column label="说明" prop="remark" min-width="180" align="center" />
    </el-table>
    <pagination class="page-view" v-show="totalNum > 0" :total="totalNum" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
  </div>

</template>

<script>
import { appLogCash } from "@/api/vip/vip";

export default {
  name: 'FormView',
  props: {
    queryParams: {
      type: Object,
    },
  },

  data() {
    return {
      loading: false,
      list: [],
      totalNum: 0,

      //流水类型（10现金充值、11现金提现、12售出入账、13转售失败收益、14提现退回、20佣金获得、21佣金转现、30保证金、
      //31余款支付，40转售手续费，41确权费，50购买席位，51席位收益，60购买消费品，
      //61兑换商品、62兑换商品手续费、70金会员服务收益、80管理端操作现金、81管理端操作佣金）
      typeCode: [
        { label: '现金充值', value: 10 },
        { label: '现金提现', value: 11 },
        { label: '售出入账', value: 12 },
        { label: '转售失败收益', value: 13 },
        { label: '提现冻结', value: 14 },
        { label: '提现退回', value: 15 },
        { label: '佣金获得', value: 20 },
        { label: '佣金转现', value: 21 },
        { label: '保证金', value: 30 },
        { label: '余款支付', value: 31 },
        { label: '转售手续费', value: 40 },
        { label: '确权费', value: 41 },
        { label: '购买席位', value: 50 },
        { label: '席位收益', value: 51 },
        { label: '购买消费品', value: 60 },
        { label: '兑换商品', value: 61 },
        { label: '兑换商品手续费', value: 62 },
        { label: '金会员服务收益', value: 70 },
        { label: '管理端操作现金', value: 80 },
        { label: '管理端操作佣金', value: 81 },
      ],

      //出金审批（0待审核,1审核通过,2退回用户,3审核拒绝,4出金中,5出金完成,6出金失败）
      status: [
        { label: '待审核', value: 0 },
        { label: '审核通过', value: 1 },
        { label: '退回用户', value: 2 },
        { label: '审核拒绝', value: 3 },
        { label: '出金中', value: 4 },
        { label: '出金完成', value: 5 },
        { label: '出金失败', value: 6 },
      ],

    }
  },

  created() {
    this.getList();
  },

  methods: {
    getList() {
      this.loading = true;
      appLogCash(this.queryParams).then((response) => {
        if (response.code == 200) {
          this.list = response.data;
          this.totalNum = response.total;
        }
        this.loading = false;
      });
    }
  }
}
</script>
<style scoped>
.page-view {
  margin-top: 10px;
  height: 50px;
}
</style>
